<?php


namespace Tests;

use Illuminate\Foundation\Console\Kernel;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
class TestCase extends BaseTestCase
{

    /**
     * Creates the application.
     *
     * Needs to be implemented by subclasses.
     *
     * @return \Symfony\Component\HttpKernel\HttpKernelInterface
     */
    public function createApplication()
    {
        $app = require __DIR__ . '/../bootstrap/app.php';
        $app->make(Kernel::class)->bootstrap();
        return $app;
    }

    /**
     * 输出友好Json|Object|Array数据
     *
     * @param        $jsonObject mixed
     * @param string $title 标题
     */
    static public function echoJson($jsonObject, $title = '')
    {
        if (!empty($title)) {
            echo "━━━━━━↘↘↘↘↘↘↘↘↘↘↘↘↘↘━━【 " . $title . " 】━━↙↙↙↙↙↙↙↙↙↙↙↙↙↙━━━━━━";
        }
        if (is_string($jsonObject)) {
            echo "━━> 非Json | Array： ";
        }
        echo PHP_EOL . json_encode($jsonObject, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
        echo '￣￣￣￣￣￣￣￣￣￣￣￣￣￣↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣' . PHP_EOL;
    }
}
